<template>
 <view class="goods-item">
   <view class="goods-item-left">
     <image :src="goods.goods_small_logo" mode="" class="image"></image>
   </view>
   <view class="goods-item-right">
     <view class="goods-info">
       {{goods.goods_name}}
     </view>
     <view class="goods-price">
      ¥ {{formattedPrice}}
     </view>
   </view>
 </view>
</template>

<script>
  export default {
    name:"my-goods",
    props:{
      goods:{
        type:Object,
        default:{}
      }
    },
    data() {
      return {
        
      };
    },
    computed:{
      formattedPrice(){
        return this.goods.goods_price.toFixed(2)
      }
    }
  }
</script>

<style lang="scss">
 .goods-item{
     display: flex;
     padding: 10rpx 15rpx;
     border-bottom: #efefef 2rpx solid;
    .goods-item-left{
      margin-right: 10rpx;
      .image{
        width: 180rpx;
        height: 180rpx;
      }
    }
    .goods-item-right{
      .goods-info{
        font-size: 30rpx;
        margin-bottom: 100rpx;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 限制显示的行数 */
        -webkit-box-orient: vertical;
        overflow: hidden; /* 隐藏超出部分 */
        text-overflow: ellipsis;
    }
    .goods-price{
      font-size: 35rpx;
      color: #c00000;
    }
  }
}
</style>